/*
 * @Author: lxw
 * @Date: 2021-02-22 11:16:12
 * @Description: 全局过滤器
 */

import dayjs from 'dayjs'
import relativeTime from 'dayjs/plugin/relativeTime'
import 'dayjs/locale/zh-cn'
dayjs.locale('zh-cn')
dayjs.extend(relativeTime)

export default {
  install (vm) {
    vm.filter('fromNow', value => dayjs(value).fromNow())
  }
}
